#include <51func.h>
int main(int argc, char *argv[])
{
    if(fork()){
        printf("parent, pid = %d, pgid = %d\n",
               getpid(), getpgid(0));
        wait(NULL);
    }
    else{
        printf("before child, pid = %d, pgid = %d\n",
               getpid(), getpgid(0));
        setpgid(0,0);
        printf("after child, pid = %d, pgid = %d\n",
               getpid(), getpgid(0));
        while(1){
            sleep(1);
        }
    }
    return 0;
}

